package com.mls.fivedistrict.server;

import com.mls.fivedistrict.common.PageFilter;
import com.mls.fivedistrict.common.ServiceResponse;
import com.mls.fivedistrict.pojo.CalculateAndProperty;
import com.mls.fivedistrict.pojo.Task;
import com.mls.fivedistrict.pojo.UserTask;

import java.util.Map;

/**
 * Created by lixiang 2018/3/24
 */
public interface TaskService {
    ServiceResponse addTask(Task task);

    ServiceResponse editTask(Task task, Long TaskId);

    ServiceResponse getTaskList(PageFilter pageFilter);

    ServiceResponse getTask(Long Taskid);

    ServiceResponse saftDeleteTask(Long TaskId);

    ServiceResponse deleteTask(Long TaskId);

    ServiceResponse getUserTask(PageFilter pageFilter);


    ServiceResponse getCategoryList();

    /**
     * 完成某一任务
     *
     * @param taskId
     * @return
     */
    int completeTask(Long taskId, Long userId,String source);

    /**
     * 完成绑定账号任务
     *
     * @param taskId
     * @return
     */
    int completeBindTask(Long taskId, Long userId, Map params);

    /**
     * 为实名认证提供的任务完成方法
     * @param taskId
     * @param userId
     * @return
     */
    CalculateAndProperty completeTaskForAuth(Long taskId, Long userId);


    /**
     * 当邀请的好友完成实名认证给邀请人增加算力
     * @param taskId
     * @param userId
     * @return
     */
    CalculateAndProperty completeTaskForInviterAuth(Long taskId, Long userId);
    /**
     * 通过任务类型获取任务
     *
     * @param category
     * @return
     */
    Task getTaskByCategory(String category);

    /**
     * 判断用户是否人脸识别
     * @param userId
     * @return
     */
    UserTask getUserIsFace(Long userId);


    /**
     * 获取所有的任务
     *
     * @return
     */
    ServiceResponse getAllTask();
    Task gettaskDetail(Long taskId);
}
